import Vue from 'vue'
import Router from 'vue-router'
const _import = require('./_import')
import Layout from '@/views/layout/Layout'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/home',
      component: Layout,
      children:[
        { path: '/home', name: 'home', component: _import('home/home') },
        { path: '/filterGoodsList', name: 'filterGoodsList', component: _import('home/filterGoodsList') },
        { path: '/shopCart', name: 'shopCart', component: _import('home/shopCart') },
        { path: '/zhiFuBaoSuccRet', name: 'zhiFuBaoSuccRet', component: _import('order/zhiFuBaoSuccRet') },
        { path: '/browseRecord', name: 'browseRecord', component: _import('goods/browseRecord') },
        { path: '/goodsInfo', name: 'goodsInfo', component: _import('goods/goodsInfo') },
        { path: '/goodsList', name: 'goodsList', component: _import('goods/goodsList') },
        { path: '/personal', name: 'personal', component: _import('own/personal') },
        { path: '/addOrder', name: 'addOrder', component: _import('order/addOrder') },
        { path: '/allOrderInfo', name: 'allOrderInfo', component: _import('order/allOrderInfo') },
        { path: '/completed', name: 'completed', component: _import('order/completed') },
        { path: '/payment', name: 'payment', component: _import('order/payment') },
        { path: '/deliverGoods', name: 'deliverGoods', component: _import('order/deliverGoods') },
        { path: '/receiveGoods', name: 'receiveGoods', component: _import('order/receiveGoods') },
        { path: '/comment', name: 'comment', component: _import('order/comment') },
        /** 退货订单路由 **/
        { path: '/returnGoods', name: 'returnGoods', component: _import('order/returnGoods') },
        /** 退货订单操作页面 **/
        { path: '/returnOperation', name: 'returnOperation', component: _import('order/components/returnOperation') },
      ]
    },
    /** 支付页面 **/
    { path: '/orderPay', name: 'orderPay', component: _import('order/orderPay') },
    { path: '/login', name: 'login', component: _import('login/login') },
    { path: '/register', name: 'register', component: _import('login/register') },
    { path: '/reset', name: 'reset', component: _import('login/reset') },
    { path: '/404', name: '404', component: _import('layout/errorPage/404') },
    { path: '*', redirect: '/404'},
  ]
})
